package kr.hkit.powerjava.chapter10.submit;

import java.util.Random;

class Number2 {

	private Random rnd;
	/*
	 * private static int i;
	 */int[] num = new int[10];

	public Number2() { // 랜덤 수 rnd에 넣자
		rnd = new Random();
	}

	public int getNum() { // 랜덤 수 리턴받자
		return rnd.nextInt(100) + 1;
	}

	public void getNum2() { // 랜덤 수 num배열에 넣음.
//		int[] n = new int[10];
		int n ;
		for (int i = 0; i < num.length; i++) {
			n = getNum()/10;
			num[i] = n;
		
			
		}
	}	
	
	public void getDistribution() { //별찍기
			int i ;
			for (i = 0 ; i <10-num[i]; i++ )
//				System.out.print(num[i] + " ");
			
				
				for (int j = 0; j <num[i]; j++)
				System.out.println((0+i)+"-" + (0+1)*10+ ":"+ " * ");
				
				
			/*	
				for (int j = 0; j <num[i]; j++ ) {
					
					
					System.out.printf("%2d %s %2d %s", 1, "-", i*10, ":");

			System.out.print(num[i]);
				System.out.print("*");
					System.out.println("*");
					System.out.println();*/
				}
				
			
	
				
				
			}
			

		
	



/*public void getDistri() {

System.out.print("1 - 10: ");
for (int i = 0; i < num.length; i++)
	if (num[i] > 0 && num[i] < 11) {
		System.out.print("*");
	}
System.out.println(" ");

}*/
